package com.hkts.management.order.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hkts.management.model.PO.OrderAndContract;
import com.hkts.management.model.VO.OrderByStatusVo;
import com.hkts.management.model.enums.OrderTypeEnum;
import com.hkts.management.order.entity.HktsOrder;
import com.hkts.management.order.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author hml
 * @since 2021-04-24
 */
@Mapper
public interface HktsOrderMapper extends BaseMapper<HktsOrder> {
    int updateByOrderId(String id, OrderTypeEnum status, Integer substate, LocalDateTime time);
    int updateOnShipperByOrderId(String id, OrderTypeEnum status, Integer substate,String consignee,LocalDateTime time);

    int updateShipperByOrderId(String id, OrderTypeEnum status, Integer substate,LocalDateTime time);

    List<Map<String, Object>> getOrderPageByStatus(OrderByStatusVo orderByStatusVo);

    int updateByCargoId(String cargoId,LocalDateTime time);

    List<Map<String, Object>> selectCountAndStatus(String driverId);

    //        List<OrderAndContract> selectOrderAndContract(@Param(Constants.WRAPPER) Wrapper<?> wrapper);
    IPage<OrderAndContract> selectOrderAndContract(Page<OrderAndContract> page, @Param(Constants.WRAPPER) Wrapper<?> wrapper);


    IPage<PayListVo> selectPayPage(Page<PayListVo> page,@Param("vo") PayParamtersVo vo);

    PayDetailInfoVo getPayDetail(String orderId);

    void updatePayInfo(UpdatePayInfoParameterVo vo);

    int updateAddressInfo(UpdateAddressInfoParameterVo addressInfoParameterVo);

    int updateCancelOrder(CancelOrderInfoParameterVo cancelOrderInfoParameterVo);

    List<PayExportListVo> selectPayList(@Param("vo") PayParamtersVo vo);

    void updateOrderAddressById(String startAddress,String endAddress,String id);

    void selectByTitle();
}
